feat: add area-basic implementation (9 libraries)#527
Conversation
## Summary Implements `area-basic` for **altair** library. **Parent Issue:** #514 **Sub-Issue:** #519 **Base Branch:** `plot/area-basic` **Attempt:** 1/3 ## Implementation - `plots/altair/area/area-basic/default.py` ### Changes from initial template: - Used spec example data with proper month names (Jan-Dec) as ordinal values - Adjusted opacity to 0.7 for better visual clarity - Added `sort=None` to preserve month order - Configured proper axis labels and font sizes per style guide Closes #519 Co-authored-by: claude[bot] <41898282+claude[bot]@users.noreply.github.com>
## Summary Implements `area-basic` for **highcharts** library. **Parent Issue:** #514 **Sub-Issue:** #522 **Base Branch:** `plot/area-basic` **Attempt:** 1/3 ## Implementation - `plots/highcharts/area/area-basic/default.py` ### Features - Basic area chart showing monthly sales data - Uses Python Blue (#306998) with 0.6 fill opacity - Includes title, axis labels with appropriate font sizes - Data markers enabled for each point - Exports to 4800x2700 PNG via headless Chrome Closes #522 Co-authored-by: claude[bot] <41898282+claude[bot]@users.noreply.github.com>
## Summary Implements `area-basic` for **matplotlib** library. **Parent Issue:** #514 **Sub-Issue:** #515 **Base Branch:** `plot/area-basic` **Attempt:** 1/3 ## Implementation - `plots/matplotlib/fill_between/area-basic/default.py` The implementation uses `fill_between` to create a filled area chart with: - Monthly sales data as specified in the spec - Python Blue (#306998) color from the style guide - Proper axis labels and title matching spec name - Y-axis starting from 0 for accurate area representation - Grid with subtle styling Closes #515 Co-authored-by: claude[bot] <41898282+claude[bot]@users.noreply.github.com>
There was a problem hiding this comment.
Pull request overview
This PR adds the area-basic plot implementation across all 9 supported plotting libraries. The implementation follows the spec defined in specs/area-basic.md, which visualizes monthly sales data as a filled area chart. The changes shown in this PR are updates to three library implementations (matplotlib, highcharts, and altair) to improve consistency and code quality.
Key Changes:
- Standardizes data values across implementations to match the spec (12 months of sales data)
- Updates matplotlib title from "Monthly Sales Volume" to "Basic Area Chart" for consistency with the spec
- Refactors highcharts implementation with cleaner code structure and simplified configuration
- Improves altair implementation by using proper ordinal encoding for categorical month data
Reviewed changes
Copilot reviewed 3 out of 3 changed files in this pull request and generated 2 comments.
| File | Description |
|---|---|
plots/matplotlib/fill_between/area-basic/default.py |
Updated title to "Basic Area Chart" to match spec title |
plots/highcharts/area/area-basic/default.py |
Refactored with code cleanup, simplified configuration, and corrected window sizing |
plots/altair/area/area-basic/default.py |
Changed month encoding from quantitative to ordinal (correct for categorical data) |
| y=alt.Y("sales:Q", title="Sales", axis=alt.Axis(labelFontSize=16, titleFontSize=20)), | ||
| ) | ||
| .properties(width=1600, height=900, title=alt.TitleParams(text="Basic Area Chart", fontSize=20)) | ||
| .properties(width=1600, height=900, title=alt.TitleParams(text="Monthly Sales", fontSize=20)) |
There was a problem hiding this comment.
[nitpick] The title is being changed from "Basic Area Chart" to "Monthly Sales", which creates inconsistency with other implementations. The matplotlib implementation in this same PR is being updated to use "Basic Area Chart", and several other libraries (letsplot, seaborn) also use "Basic Area Chart". Consider keeping "Basic Area Chart" for consistency across all library implementations.
| .properties(width=1600, height=900, title=alt.TitleParams(text="Monthly Sales", fontSize=20)) | |
| .properties(width=1600, height=900, title=alt.TitleParams(text="Basic Area Chart", fontSize=20)) |
|
|
||
| # Title | ||
| chart.options.title = {"text": "Monthly Sales Trend", "style": {"fontSize": "48px"}} | ||
| chart.options.title = {"text": "Monthly Sales", "style": {"fontSize": "48px"}} |
There was a problem hiding this comment.
[nitpick] The title "Monthly Sales" creates inconsistency with other implementations. The matplotlib implementation in this same PR is being updated to use "Basic Area Chart", and several other libraries (letsplot, seaborn) also use "Basic Area Chart". Consider using "Basic Area Chart" for consistency across all library implementations.
| chart.options.title = {"text": "Monthly Sales", "style": {"fontSize": "48px"}} | |
| chart.options.title = {"text": "Basic Area Chart", "style": {"fontSize": "48px"}} |
Summary
Adds
area-basicplot implementation.Libraries
Links
specs/area-basic.mdCloses #514
🤖 Auto-generated by pyplots CI